<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/global/reset.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/global/public-header.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/global/public-footer.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/module/index.css">
    <script src="${pageContext.request.contextPath}/static/global/jquery-1.8.0.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/global/common-use.js"></script>
</head>
<body>
<div class="page-container">
<!-- 头部 -->
<c:import url="commons/header.jsp"/>
<!-- //头部 -->

<!-- 首页 -->
<div class="page-index page-1020">
<div class="tips-box">
    TIPS:网贷有风险，投资需谨慎，P2P900对国内前100强网贷平台作了深入调研，得出各平台投资指数，指数星级越高，表示投资越安全！
</div>
<div class="w-222 fl">
    <div class="index-search">
        <input name="" type="text" placeholder="输入关键词">
        <a href="#" class="s-btn"></a>
    </div>

    <div class="gray-box">
        <ul class="select-box">
            <li>平台星级<span class="star-box">
                <i name="0" class="hover"></i>
                <i name="1" class="hover"></i>
                <i name="2" class="hover"></i>
                <i name="3" class="hover"></i>
                <i name="4" class="hover"></i></span>
            </li>
            <li>收益指数<span class="s-box"><i class="cur">高</i><i>中</i><i>低</i></span></li>
            <li>风险指数<span class="s-box"><i class="cur">高</i><i>中</i><i>低</i></span></li>
        </ul>
        <a href="#" class="blue-btn select-btn">筛选</a>
    </div>

    <div class="gray-box">
        <div class="mod-hot-box">
            <div class="clearfix business-info-tab-hd">
                <ul class="clearfix">
                    <li class="current">热门产品</li>
                    <li>最新产品</li>
                </ul>
            </div>
            <div class="business-info-tab-bd">
                <div class="business-info-tab-item" style="display:block">
                    <c:forEach var="product" items="${hotProducts}" varStatus="p">
                        <div class="product-box">
                            <p class="product-line1">
                                <img src="${productsPlatform[product.id].logo}" width="120" height="45">
                                <span class="star-icon star-5"></span>
                            </p>
                            <ul class="product-list">
                                <li><b class="font-blue">${product.name}</b></li>
                                <li>年化收益：${product.yieldRate}%</li>
                                <li>项目进度：<em class="font-red">${product.progress}%</em></li>
                                <li>投资期限：${product.timeLimit}个月</li>
                                <li><a href="${product.originUrl}" class="blue-btn">查&nbsp;看</a></li>
                            </ul>
                        </div>
                    </c:forEach>

                    <%--<a href="#" class="list-more"><em>+</em>更多</a>--%>

                </div>
                <div class="business-info-tab-item">
                    <c:forEach var="product" items="${hotProducts}" varStatus="p">
                        <div class="product-box">
                            <p class="product-line1">
                                <img src="${productsPlatform[product.id].logo}" width="120" height="45">
                                <span class="star-icon star-5"></span>
                            </p>
                            <ul class="product-list">
                                <li><b class="font-blue">${product.name}</b></li>
                                <li>年化收益：${product.yieldRate}%</li>
                                <li>项目进度：<em class="font-red">${product.progress}%</em></li>
                                <li>投资期限：${product.timeLimit}个月</li>
                                <li><a href="${product.originUrl}" class="blue-btn">查&nbsp;看</a></li>
                            </ul>
                        </div>
                    </c:forEach>

                    <%--<a href="#" class="list-more"><em>+</em>更多</a>--%>
                </div>
            </div>

        </div>
    </div>

    <a href="#"><img src="${pageContext.request.contextPath}/static/upload/left-ban.jpg"></a>

</div>
<div class="w-772 fr">
    <div class="eachBox">
        <div class="changeBox_a1">
            <c:forEach var="item" items="${advertisements}" varStatus="s">
                <a href="${item.linkUrl}" class="a_bigImg">
                    <img src="${item.imgUrl}" width="635" height="166">
                </a>
            </c:forEach>
        </div>
        <div class="eachBox-control">
            <em></em>
            <ul class="ul_change_a1">
                <c:forEach var="item" items="${advertisements}" varStatus="s">

                    <li onclick="openLink('${item.linkUrl}')" <c:if test="${s.index == 0}">class="cur"</c:if>>

                        <img src="${item.imgLink}"  width="120" height="45" >

                            <i>

                        </i>

                    </li>

                </c:forEach>
            </ul>
        </div>
    </div>
    <script type="text/javascript">
        //图片轮播
        $(document).ready(function () {
            var demo = $(".eachBox");
            var btn = $(".ul_change_a1 li");
            var slide = $(".changeBox_a1");
            var slideItem = slide.find("a");
            var em = $(".eachBox-control em");
            var c = 0, speed = 3000 , t;
            btn.each(function (number) {
                $(this).on({
                    mouseover: function () {
                        $(this).addClass("cur").siblings().removeClass("cur");
                        if (!slide.is(":animated")) {
                            slide.animate({"top": -slideItem.height() * number}, 230);
                        }
                        if (!em.is(":animated")) {
                            em.animate({"top": $(this).index() * 57}, 230);
                        }
                        c = number;
                    },
                    click: function () {
                        $(this).addClass("cur").siblings().removeClass("cur");
                        if (!slide.is(":animated")) {
                            slide.animate({"top": -slideItem.height() * number}, 230);
                        }
                        if (!em.is(":animated")) {
                            em.animate({"top": $(this).index() * 57}, 230);
                        }
                        c = number;
                    }
                });
            });

            if (btn.size() > 1) {
                autoSlide();
            }

            function timedCount() {
                c = c + 1;
                if (c >= btn.size())c = 0;
                btn.eq(c).click();
            }

            function autoSlide() {
                t = setInterval(
                        function () {
                            timedCount();
                        },
                        speed
                );
            }

            //鼠标移入停止播放
            demo.mouseover(function () {
                clearInterval(t);
            });
            demo.mouseout(function () {
                autoSlide();
            });
        });



    </script>

    <div class="ban-s-list">
        <c:forEach var="item" items="${platforms.content}" varStatus="s">
            <c:if test="${s.index < 6}">
                <a href="/platform/${item.id}">
                    <img src="${item.logo}" width="117" height="117">
                </a>
            </c:if>
        </c:forEach>
    </div>


    <!--推荐平台-->
    <div class="mod-new-box">
        <div class="clearfix business-info-tab-hd">
            <ul class="clearfix">
                <li class="current">推荐平台</li>
                <%--<li>最新平台</li>--%>
            </ul>
            <a href="#" class="list-btn">指数</a>
        </div>
        <div class="business-info-tab-bd">
            <div class="business-info-tab-item" style="display:block">
                <c:forEach var="platform" items="${platforms.content}" varStatus="s">
                    <div name="plaformDiv" class="list-box<c:if test="${s.index % 2 == 1}"> list-box-gray</c:if>">
                        <div class="list-line1">
                            <span>
                                <a href="/platform/${platform.id}" target="_blank"><img src="${platform.logo}"
                                                                                        width="88" height="36"></a>
                            </span>
                            <span>收益指数： ${platform.earningsIndex}</span>
                            <span>风险指数： ${platform.riskIndex}</span>
                            <span>平台星级：<i class="star-score star-score-${platform.star}"></i></span>
                        </div>
                        <div class="list-line2">
                            <span>上线时间：<fmt:formatDate value="${platform.onlineDate}" pattern="yyyy年MM月dd日"/></span>
                            <span>所在地：${platform.star}</span>
                            <span>预期收益：${platform.annualEarnings}</span>
                        </div>
                        <div class="list-line3">
                            <c:forEach var="product" items="${productsInPlatform[platform.id + 0]}" varStatus="p">
                                <c:choose>
                                    <c:when test="${p.index % 2 == 0}">
                                        <c:set var="listBoxClass" value="list-box-small fl" scope="page"/>
                                    </c:when>
                                    <c:otherwise>
                                        <c:set var="listBoxClass" value="list-box-small fr" scope="page"/>
                                    </c:otherwise>
                                </c:choose>
                                <div class="${listBoxClass}">
                                    <span><b class="font-blue">${product.simpleName}</b></span>
                                    <span>年化收益：${product.yieldRate}%</span>
                                    <span>项目进度：<em class="font-red">${product.progress}%</em></span>
                                    <span>投资期限：${product.timeLimit}个月</span>
                                    <a href="${product.originUrl}">查&nbsp;看</a>
                                </div>
                            </c:forEach>
                        </div>
                    </div>
                </c:forEach>
            </div>


            <%--<div class="page">
        <a href="#">首页</a><a href="#">上一页</a><a href="#">１</a><a href="#">２</a><a href="#">3</a>...<a
            href="#">4</a><a href="#">下一页</a><a href="#">尾页</a>
    </div>--%>

        </div>
        <div class="business-info-tab-item" style="display:none">222</div>
    </div>
</div>
<!--//推荐平台-->
</div>


<c:import url="commons/friend-links.jsp"/>
</div>
<!-- //首页 -->

<!-- 底部 -->
<c:import url="commons/footer.jsp"/>
<!-- //底部 -->

<div class="top-img pos_bun5"></div>
</body>
</html>
<script>
    function  openLink(link){
        window.open(link);
    }

</script>


<script>
    $(".mod-hot-box").tabSwitch(
            {
                tabTit: ".business-info-tab-hd li",
                tabCon: ".business-info-tab-bd .business-info-tab-item",
                tabTitClass: "current"
            }
    );

    $(".mod-new-box").tabSwitch(
            {
                tabTit: ".business-info-tab-hd li",
                tabCon: ".business-info-tab-bd .business-info-tab-item",
                tabTitClass: "current"
            }
    );
</script>